home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 351-375 / disk_370 / sksh / extcmds.doc < prev    next >
Text File  |  1992-05-06  |  40KB  |  1,717 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.                              External Command Reference
  18.  
  19.                                         SKsh
  20.  
  21.                            A ksh-like Shell for the Amiga
  22.  
  23.                                      Version 1.5
  24.  
  25.  
  26.                                (Copyright) 1989, 1990
  27.  
  28.                                      Steve Koren
  29.  
  30.                                     July 20, 1990
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.           Table of Contents
  74.  
  75.                Introduction......................................3
  76.                cat...............................................4
  77.                cmp...............................................5
  78.                cp................................................6
  79.                crc...............................................7
  80.                cut...............................................8
  81.                du................................................9
  82.                encr..............................................10
  83.                fgrep.............................................11
  84.                grep..............................................13
  85.                head..............................................15
  86.                indent............................................16
  87.                join..............................................17
  88.                num...............................................18
  89.                strings...........................................19
  90.                srun..............................................20
  91.                tail..............................................21
  92.                tee...............................................22
  93.                view..............................................23
  94.                wc................................................24
  95.                window............................................25
  96.                xd................................................26
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.           SKsh Amiga Shell             Page 2       External Cmd Reference
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.           Introduction
  140.  
  141.             This reference manual describes each SKsh external  command  in
  142.             a  concise  manner.    Each   page   contains   the   following
  143.             information:
  144.  
  145.             Name:     The name of the command.
  146.  
  147.             Type:     Always External Command for  this  document;  may  be
  148.                       something else in the reference manual.
  149.  
  150.             Default:  Default parameters, if applicable.
  151.  
  152.             Usage:    Command syntax
  153.  
  154.             Range:    Legal values for variables or parameters
  155.  
  156.             About:    Text describing the command, variable, etc.
  157.  
  158.             Example:  A brief example usage.
  159.  
  160.             See Also: Other related commands, variables, etc.
  161.  
  162.             When  reading  the  command syntax, anything in square brackets
  163.             is  optional.   Anything followed by three dots can be repeated
  164.             any  number of times.   A  vertical bar is used to separate op-
  165.             tion where one or the other, but not both, can be used.
  166.  
  167.             In general, 'command -a -b' is equilivant to 'command -ab'.
  168.  
  169.             All external commands were re-written in SKsh 1.4  to  be  much
  170.             smaller and faster than their  earlier  counterparts.   In  1.5
  171.             they are slightly smaller yet.
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.           SKsh Amiga Shell             Page 3       External Cmd Reference
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.           ________________________________________________________________
  206.  
  207.             Name:     cat
  208.  
  209.             Type:     External Command
  210.  
  211.             Default:  n/a
  212.  
  213.             Usage:    cat [ file ... ]
  214.  
  215.             Range:    n/a
  216.  
  217.             About:    cat  copies the files named on the  command line to
  218.                       its  standard output.  If no files  are  named,  it
  219.                       copies the standard input to the standard output.
  220.  
  221.                       The  cat  external command is provided as an alter-
  222.                       native to  the  builtin form; this one can copy bi-
  223.                       nary data as well as ASCII data and is much  faster
  224.                       when the output is redirected to a file.
  225.  
  226.                       To use the  external cat command by default, insert
  227.                       the following line into your .skshrc file:
  228.  
  229.                          unset -b cat
  230.  
  231.             Example:  cat myfile.foo
  232.  
  233.             See Also: The cat command entry in Reference.doc
  234.  
  235.           ________________________________________________________________
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.           SKsh Amiga Shell             Page 4       External Cmd Reference
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.           ________________________________________________________________
  272.  
  273.             Name:     cmp
  274.  
  275.             Type:     External Command
  276.  
  277.             Default:  n/a
  278.  
  279.             Usage:    cmp [ -s ] file1 file2
  280.  
  281.             Range:    n/a
  282.  
  283.             About:    cmp  compares two files for equality.   It  can  be
  284.                       used  on  binary as well  as  textual data.  cmp is
  285.                       fast in that if the files are not  the  same  size,
  286.                       it won't even bother  comparing the contents of the
  287.                       files.    cmp normally outputs a message that indi-
  288.                       cates whether the files are  the  same,  different,
  289.                       or one is shorter than the other.  If  the  -s  op-
  290.                       tion is  used,  compare does not output this infor-
  291.                       mation,  but  simply  returns a zero exit status if
  292.                       the files were the same, or non-zero if  they  were
  293.                       not.
  294.  
  295.             Example:  if cmp -s file1 file2
  296.                       then
  297.                          echo 'file1 is the same as file2'
  298.                       else
  299.                          echo 'file1 is different than file2'
  300.                       fi
  301.  
  302.             See Also:
  303.  
  304.           ________________________________________________________________
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.           SKsh Amiga Shell             Page 5       External Cmd Reference
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.  
  336.  
  337.           ________________________________________________________________
  338.  
  339.             Name:     cp
  340.  
  341.             Type:     External Command
  342.  
  343.             Default:  n/a
  344.  
  345.             Usage:    cp [ -nuv ] file { file | dir }
  346.                       cp [ -nruv ] { file | dir } ... dir
  347.  
  348.             Range:    n/a
  349.  
  350.             About:    cp  copies files from one place to another, option-
  351.                       ally  renaming them in the process.  If the  desti-
  352.                       nation  is  a  directory, the files have  the  same
  353.                       name  in  the  destination directory.  If more than
  354.                       one file is  copied, the destination must be either
  355.                       a  directory or nonexistant.  If it is nonexistant,
  356.                       it is created as a directory.
  357.  
  358.                       The -r flag causes cp to perform a recursive copy. 
  359.  
  360.                       The -v flag prints the name of each file as  it  is
  361.                       copied.
  362.  
  363.                       The -n flag causes cp NOT  to  duplicate file modi-
  364.                       fication times  and  protection flags on the desti-
  365.                       nation files.  If you wish to  make  this  the  de-
  366.                       fault behavior, use this alias:
  367.  
  368.                          alias cp='$(which cp) -n'
  369.  
  370.                       cp  will  reset the AmigaDos archive bit whether or
  371.                       not the -v flag is used.
  372.  
  373.                       The -u flag causes  cp to operate in "update" mode;
  374.                       only files with a newer  timestamp than their asso-
  375.                       ciated destination are copied.
  376.  
  377.  
  378.             Example:  cp my_file1 m_file2 my_file3 my_directory
  379.  
  380.             Warnings:  The -c (clone) flag was obsoleted in SKsh 1.4.  It
  381.                       is still  accepted for backward compatibility; how-
  382.                       ever, it is ignored.   Use  the  -n  option to turn
  383.                       off the clone behaviour.
  384.  
  385.                       The  cp  command was changed to an  external binary
  386.                       in SKsh 1.4.  It used to be a builtin.
  387.  
  388.             See Also: mv
  389.  
  390.           ________________________________________________________________
  391.  
  392.  
  393.           SKsh Amiga Shell             Page 6       External Cmd Reference
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.           ________________________________________________________________
  404.  
  405.             Name:     crc
  406.  
  407.             Type:     External Command
  408.  
  409.             Default:  n/a
  410.  
  411.             Usage:    crc file1 file2
  412.  
  413.             Range:    n/a
  414.  
  415.             About:    crc  generates several 32 bit values which are com-
  416.                       puted from a file's contents.  These  values can be
  417.                       used  to  check  the  integrity of files which  are
  418.                       transfered over a  medium of questionable reliabil-
  419.                       ity (such as phone lines).
  420.  
  421.             Example:  crc a_file another_file
  422.  
  423.             See Also:
  424.  
  425.           ________________________________________________________________
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458.  
  459.           SKsh Amiga Shell             Page 7       External Cmd Reference
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.  
  468.  
  469.           ________________________________________________________________
  470.  
  471.             Name:     cut
  472.  
  473.             Type:     External Command
  474.  
  475.             Default:  n/a
  476.  
  477.             Usage:    cut [ -flist [ -dchar ] | -clist ] [ file ... ]
  478.  
  479.             Range:    n/a
  480.  
  481.             About:    Cut  is  used  for  making vertical slices though a
  482.                       file based  on  character position or on fields de-
  483.                       limited  by  a  defined character.  It can also  be
  484.                       used  to  re-order  characters or fields  within  a
  485.                       file.
  486.  
  487.                       The -c  option cuts based on character positions in
  488.                       the  line.   For  example, "-c1,5-10,20" would copy
  489.                       characters one, five though ten,  and  twenty  from
  490.                       each  input line  to  the  output line. If the list
  491.                       begins  with  a  dash  (for  example, "-c-10")  the
  492.                       first item is used  implicitly (1 though 10 in this
  493.                       case).    Characters  beyond the end  of  line  are
  494.                       ignored.
  495.  
  496.                       The  -f  option cuts based on field position within
  497.                       a line.  Fields are  separated by the tab character
  498.                       by  default, but this can be changed  with  the  -d
  499.                       option.   For  example, "-d:" would use colon sepa-
  500.                       rated fields.   Repeated strings of the field sepa-
  501.                       rator  indicate empty  fields.   Fields  beyond the
  502.                       last in the record are ignored.
  503.  
  504.                       No  space  may  occur between the -d option and the
  505.                       field  separator character, or between the -f or -c
  506.                       options and the list.
  507.  
  508.  
  509.  
  510.             Example:  cut -c1-10,15,20-50 myfile.txt
  511.                       cut -f1,3,5-7 -d: myfile1.txt
  512.  
  513.             See Also:
  514.  
  515.           ________________________________________________________________
  516.  
  517.  
  518.  
  519.  
  520.  
  521.  
  522.  
  523.  
  524.  
  525.           SKsh Amiga Shell             Page 8       External Cmd Reference
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.  
  534.  
  535.           ________________________________________________________________
  536.  
  537.             Name:     du
  538.  
  539.             Type:     External Command
  540.  
  541.             Default:  n/a
  542.  
  543.             Usage:    du [ -dkst ] dir ...
  544.  
  545.             Range:    n/a
  546.  
  547.             About:    du  prints  disk  usage  information for a  set  of
  548.                       directories.   For  each   directory listed on  the
  549.                       command line,  the  subtree rooted at that point is
  550.                       searched in a depth-first manner.   du adds all the
  551.                       file sizes, and for  each  directory, prints 1) the
  552.                       directory name, 2)  the  total disk usage for files
  553.                       in this  directory, and 3) the total disk usage for
  554.                       the subtree rooted at this directory.
  555.  
  556.                       The following options are available:
  557.  
  558.                          -k   Print  disk  usage in 1024  byte  kilobytes
  559.                               instead of the default bytes.
  560.  
  561.                          -s   Summary  mode;  print  disk  usage only for
  562.                               root  directories  listed  on  the  command
  563.                               line.   This   option omits the display for
  564.                               any sub-directories, but still  must  exam-
  565.                               ine  the  entire  directory subtree to find
  566.                               the total disk usage.
  567.  
  568.                          -d   Omit the first  disk  usage number (the to-
  569.                               tal for this directory only).
  570.  
  571.                          -t   Omit the  second disk usage number (the to-
  572.                               tal for  the  subtree rooted at this direc-
  573.                               tory).   If  both  -t and -d are used, only
  574.                               directory names are printed.
  575.  
  576.             Example:  du devs: ram:
  577.                       du -s devs:
  578.  
  579.             Warnings: The  -k option rounds to the nearest kilobyte.  For
  580.                       example, a 1023 byte file is printed as 1K,  and  a
  581.                       511 byte file is printed as 0K.   This  means  that
  582.                       the rooted  subtree disk usage count may not be the
  583.                       sum  of  the  directory  disk  usage counts for all
  584.                       subdirectories.
  585.  
  586.             See Also: info
  587.  
  588.           ________________________________________________________________
  589.  
  590.  
  591.           SKsh Amiga Shell             Page 9       External Cmd Reference
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.           ________________________________________________________________
  602.  
  603.             Name:     encr
  604.  
  605.             Type:     External Command
  606.  
  607.             Default:  n/a
  608.  
  609.             Usage:    encr { -d|-e } key { infile | - } { outfile | - }
  610.  
  611.             Range:    4 <= strlen(key) <= max parameter length
  612.  
  613.             About:    encr  encrypts  (-e)  and  decrypts (-d) files,  or
  614.                       standard  input  and  output if the  file  name  is
  615.                       given as a dash.  The key value must  be  the  same
  616.                       for  the  encrypt  and  decrypt; otherwise, garbage
  617.                       will result.   The  key  may  be  of  any  passable
  618.                       length.  Longer keys  will  result in a more secure
  619.                       encryption.
  620.  
  621.                       The  encrypted data will in most cases not be ASCII
  622.                       data.    However, this can be an  advantage in that
  623.                       encr  can  be  used  to  encrypt  binary as well as
  624.                       ASCII data.
  625.  
  626.                       If  encrypted data is  to  be  compressed, the com-
  627.                       press  operation  should  be  performed  before the
  628.                       data is  encrypted, not after.  This is because the
  629.                       encrypted  data  will  appear  random, and hence be
  630.                       difficult to compress by the standard algorithms.
  631.  
  632.                       encr does not use the DES  algorithm, as code based
  633.                       on  that  algorithm is not shippable outside of the
  634.                       United States.  (This is a bit  paranoid if you ask
  635.                       me, but no one did).  For  obvious reasons, I'm not
  636.                       going  to  describe  the  encr algorithm here.  The
  637.                       algorithm should  be  plenty  secure enough to dis-
  638.                       courage  casual  perusal of  encrypted data.  It is
  639.                       probably  not  secure enough to keep  data  from  a
  640.                       dedicated   cryptoanalyst,  or  perhaps  even  from
  641.                       someone who is  willing to closely examine a disas-
  642.                       sembly  of  the  program code.  I  have  provided a
  643.                       small  file  with  this  release of SKsh which con-
  644.                       tains some encrypted english  text;  I  would  very
  645.                       much like  to  hear  if  anyone manages to find out
  646.                       what it says.  The file is called "crypted_data". 
  647.  
  648.             Example:  encr -e mykey plainfile encryptedfile
  649.                       encr -d mykey encryptedfile plainfile
  650.  
  651.             See Also:
  652.  
  653.           ________________________________________________________________
  654.  
  655.  
  656.  
  657.           SKsh Amiga Shell            Page 10       External Cmd Reference
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.           ________________________________________________________________
  668.  
  669.             Name:     fgrep
  670.  
  671.             Type:     External Command
  672.  
  673.             Default:  n/a
  674.  
  675.             Usage:    fgrep -[vxcilns] [-f pfile] [-e] pattern
  676.                          [ file ... ]
  677.  
  678.             Range:    n/a
  679.  
  680.             About:    fgrep  provides a fast way to search for text  pat-
  681.                       terns in a set of  files.   It  is  similar to, al-
  682.                       though more limited but faster than, grep.
  683.  
  684.                       fgrep  searches  for  the  indicated pattern in the
  685.                       indicated set of files, if present,  or  the  stan-
  686.                       dard  input, if not.  An fgrep pattern is extremely
  687.                       limited; it  can  be  either a string constant or a
  688.                       set  of  string   constants  separated  by  percent
  689.                       signs.   For  example, these are valid fgrep state-
  690.                       ments:
  691.  
  692.                          fgrep my_routine *.c
  693.                          fgrep 'this%or%that' my_file my_other_file
  694.  
  695.                       In  the  second  example,  fgrep searches for lines
  696.                       containing any of the three strings.
  697.  
  698.                       There are a large  number of options availble which
  699.                       modify the actions of fgrep:
  700.  
  701.                       -c   Print only a count of  matching lines for each
  702.                            file.  If the 'v'  option is used with the 'c'
  703.                            option,  a  count  of  non-matching  lines  is
  704.                            printed.
  705.  
  706.                       -e   Use  the  next  argument as the pattern.  This
  707.                            is  useful to  search  for  patterns beginning
  708.                            with a dash.
  709.  
  710.                       -f   Use  the  next  argument as a file which  con-
  711.                            tains  a  newline  separated list  of  values.
  712.                            This file is read and used  in  place  of  the
  713.                            command line pattern.   For  example, the fol-
  714.                            lowing two examples are equivalent:
  715.  
  716.                               fgrep 'foo%bar' myfile
  717.  
  718.                               echo "foo" >temp; echo "bar" >>temp
  719.                               fgrep -f temp myfile
  720.  
  721.  
  722.  
  723.           SKsh Amiga Shell            Page 11       External Cmd Reference
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.                       -i   Ignore case in  the  search.   Normally, fgrep
  734.                            is case sensitive.
  735.  
  736.                       -l   Print only the names of files  which  containg
  737.                            the given pattern.  This  is  fast;  if  fgrep
  738.                            finds  the  pattern  anywhere in the file,  it
  739.                            will  stop  looking  and  proceed to the  next
  740.                            file.  This can  save  time  for  large  files
  741.                            where  the  task  is  to  discover which files
  742.                            contain the given pattern.
  743.  
  744.                       -n   Print  the  line  number  before each matching
  745.                            line.
  746.  
  747.                       -s   Print  nothing.    Return an exit  code  of  0
  748.                            (true) if any  file  contained the pattern, or
  749.                            1 (false) if no files contained the pattern.
  750.  
  751.                       -v   Invert the search.  Lines which  do  not  con-
  752.                            tain the pattern are printed.
  753.  
  754.                       -x   Lines  must  match  the  pattern  exactly, not
  755.                            simply contain it.
  756.  
  757.             Example:  if grep -s my_pattern my_file
  758.                       then
  759.                          echo 'my_file contains my_pattern'
  760.                       fi
  761.  
  762.             Warnings: Patterns  which  contain '%', spaces, or other spe-
  763.                       cial  characters should be quoted  to  avoid  being
  764.                       interpreted by the shell.
  765.  
  766.                       The  '%'  character is used to separate strings in-
  767.                       stead of a newline as in Un*x, as there is a  prob-
  768.                       lem  in  AmigaDos   passing  parameters  containing
  769.                       newlines to external commands.
  770.  
  771.             See Also: grep
  772.  
  773.           ________________________________________________________________
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.           SKsh Amiga Shell            Page 12       External Cmd Reference
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.           ________________________________________________________________
  800.  
  801.             Name:     grep
  802.  
  803.             Type:     External Command
  804.  
  805.             Default:  n/a
  806.  
  807.             Usage:    grep -[vxcilns] [-f pfile] [-e] pattern
  808.                          [ file ... ]
  809.  
  810.             Range:    n/a
  811.  
  812.             About:    grep  provides a way to search for text patterns in
  813.                       a set of files.   It  is  similar to, although more
  814.                       powerful but slower than, fgrep.
  815.  
  816.                       grep searches for the  indicated pattern in the in-
  817.                       dicated set of files, if present, or  the  standard
  818.                       input, if not.  A  grep  pattern is a limited regu-
  819.                       lar  expression.   An   explaination of regular ex-
  820.                       pressions  is  beyond the scope of  this  document;
  821.                       however, it should be noted that  although they ap-
  822.                       pear  similar to wildcards, they are much different
  823.                       (and more powerful).
  824.  
  825.                       There are a large  number of options availble which
  826.                       modify the actions of grep:
  827.  
  828.                       -c   Print only a count of  matching lines for each
  829.                            file.  If the 'v'  option is used with the 'c'
  830.                            option,  a  count  of  non-matching  lines  is
  831.                            printed.
  832.  
  833.                       -e   Use  the  next  argument as the pattern.  This
  834.                            is  useful to  search  for  patterns beginning
  835.                            with a dash.
  836.  
  837.                       -f   Use  the  next  argument as a file which  con-
  838.                            tains  a  one-line  regular expression.  There
  839.                            can  only  be  one  regular expression in this
  840.                            version  of  grep, so this option is currently
  841.                            of  limited use.  However, if grep is extended
  842.                            to  permit  multiple  expressions, the 'f' op-
  843.                            tion will become more useful.
  844.  
  845.                       -i   Ignore case in the search.   Normally, grep is
  846.                            case sensitive.
  847.  
  848.                       -l   Print only the names of files  which  containg
  849.                            the given pattern.   This  is  fast;  if  grep
  850.                            finds  the  pattern  anywhere in the file,  it
  851.                            will  stop  looking  and  proceed to the  next
  852.                            file.  This can  save  time  for  large  files
  853.  
  854.  
  855.           SKsh Amiga Shell            Page 13       External Cmd Reference
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864.  
  865.                            where  the  task  is  to  discover which files
  866.                            contain the given pattern.
  867.  
  868.                       -n   Print  the  line  number  before each matching
  869.                            line.
  870.  
  871.                       -s   Print  nothing.    Return an exit  code  of  0
  872.                            (true) if any  file  contained the regular ex-
  873.                            pression, or 1 (false) otherwise.
  874.  
  875.                       -v   Invert the search.  Lines which  do  not  con-
  876.                            tain the regular expression are printed.
  877.  
  878.                       -x   The  expression must be found at the beginning
  879.                            of a line.
  880.  
  881.             Example:  if grep -s my_pattern my_file
  882.                       then
  883.                          echo 'my_file contains my_pattern'
  884.                       fi
  885.  
  886.             Warnings: Patterns  which  contain '*', '.', spaces, or other
  887.                       special  characters should be quoted to avoid being
  888.                       interpreted by the shell.
  889.  
  890.                       Be  wary  of  the  difference in the 'x' option be-
  891.                       tween fgrep and grep.
  892.  
  893.                       fgrep  often  more  useful than grep because of its
  894.                       greater speed  and  smaller  size.   This  is  most
  895.                       noticable  on  fast  devices such as  ram  or  hard
  896.                       disks.
  897.  
  898.             See Also: fgrep
  899.  
  900.           ________________________________________________________________
  901.  
  902.  
  903.  
  904.  
  905.  
  906.  
  907.  
  908.  
  909.  
  910.  
  911.  
  912.  
  913.  
  914.  
  915.  
  916.  
  917.  
  918.  
  919.  
  920.  
  921.           SKsh Amiga Shell            Page 14       External Cmd Reference
  922.  
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.  
  930.  
  931.           ________________________________________________________________
  932.  
  933.             Name:     head
  934.  
  935.             Type:     External Command
  936.  
  937.             Default:  num = 10
  938.  
  939.             Usage:    head [ -num ] [ file ... ]
  940.  
  941.             Range:    0 <= num
  942.  
  943.             About:    head  prints  the  first  num lines of  each  named
  944.                       file,  or  the  standard  input  if  no  files  are
  945.                       indicated.  If  num is not explicitly set, it has a
  946.                       default value of 10.
  947.  
  948.             Example:  head -5 my_file.c my_other_file.c
  949.  
  950.             See Also: tail
  951.  
  952.           ________________________________________________________________
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.  
  961.  
  962.  
  963.  
  964.  
  965.  
  966.  
  967.  
  968.  
  969.  
  970.  
  971.  
  972.  
  973.  
  974.  
  975.  
  976.  
  977.  
  978.  
  979.  
  980.  
  981.  
  982.  
  983.  
  984.  
  985.  
  986.  
  987.           SKsh Amiga Shell            Page 15       External Cmd Reference
  988.  
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.  
  996.  
  997.           ________________________________________________________________
  998.  
  999.             Name:     indent
  1000.  
  1001.             Type:     External Command
  1002.  
  1003.             Default:  char = space
  1004.                       num = 4
  1005.  
  1006.             Usage:    indent [ -num ] [ -cchar ] [ file ... ]
  1007.  
  1008.             Range:    n/a
  1009.  
  1010.             About:    Indent  inserts  the  defined character (a space by
  1011.                       default) a given  number of times (4 by default) at
  1012.                       the  beginning  of  every line of a file which does
  1013.                       not  contain only a newline.  That is, empty  lines
  1014.                       are left alone.
  1015.  
  1016.             Example:  indent -5 myfile.txt
  1017.  
  1018.             See Also:
  1019.  
  1020.           ________________________________________________________________
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.  
  1027.  
  1028.  
  1029.  
  1030.  
  1031.  
  1032.  
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038.  
  1039.  
  1040.  
  1041.  
  1042.  
  1043.  
  1044.  
  1045.  
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.           SKsh Amiga Shell            Page 16       External Cmd Reference
  1054.  
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.  
  1062.  
  1063.           ________________________________________________________________
  1064.  
  1065.             Name:     join
  1066.  
  1067.             Type:     External Command
  1068.  
  1069.             Default:  n/a
  1070.  
  1071.             Usage:    join [ -a ] source1 [ source2 ... ] destination
  1072.  
  1073.             Range:    n/a
  1074.  
  1075.             About:    The  join command concatinates binary or ASCII data
  1076.                       from  multiple files into a single file, optionally
  1077.                       appending the data to  the  destination file if the
  1078.                       -a flag is set.   The  destination file is the last
  1079.                       one given.
  1080.  
  1081.             Example:  join file1 file2 dest_file
  1082.  
  1083.             See Also:
  1084.  
  1085.           ________________________________________________________________
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096.  
  1097.  
  1098.  
  1099.  
  1100.  
  1101.  
  1102.  
  1103.  
  1104.  
  1105.  
  1106.  
  1107.  
  1108.  
  1109.  
  1110.  
  1111.  
  1112.  
  1113.  
  1114.  
  1115.  
  1116.  
  1117.  
  1118.  
  1119.           SKsh Amiga Shell            Page 17       External Cmd Reference
  1120.  
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.  
  1128.  
  1129.           ________________________________________________________________
  1130.  
  1131.             Name:     num
  1132.  
  1133.             Type:     External Command
  1134.  
  1135.             Default:  num = 4
  1136.  
  1137.             Usage:    num [ -digits ] [ -r ] [ file ... ]
  1138.  
  1139.             Range:    2 <= digits <= 8
  1140.  
  1141.             About:    num prints ASCII files,  prefixing each line in the
  1142.                       file with its  line  number.   By  default, 4 digit
  1143.                       line  numbers are used, but  this  can  be  changed
  1144.                       from 2  to  8  digits numbers with the command line
  1145.                       switch.
  1146.  
  1147.                       Also by  default, num resets the line number at the
  1148.                       beginning of each file.   To  use  consecutive line
  1149.                       numbers for all files, use the "-r"  switch.   With
  1150.                       that  option  selected, the line count is not reset
  1151.                       for each file.
  1152.  
  1153.             Example:  num -6 -r myfile1.c myfile2.c
  1154.  
  1155.             See Also:
  1156.  
  1157.           ________________________________________________________________
  1158.  
  1159.  
  1160.  
  1161.  
  1162.  
  1163.  
  1164.  
  1165.  
  1166.  
  1167.  
  1168.  
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175.  
  1176.  
  1177.  
  1178.  
  1179.  
  1180.  
  1181.  
  1182.  
  1183.  
  1184.  
  1185.           SKsh Amiga Shell            Page 18       External Cmd Reference
  1186.  
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.  
  1194.  
  1195.           ________________________________________________________________
  1196.  
  1197.             Name:     strings
  1198.  
  1199.             Type:     External Command
  1200.  
  1201.             Default:  num = 6
  1202.  
  1203.             Usage:    strings [ -num ] [ file ... ]
  1204.  
  1205.             Range:    0 <= num
  1206.  
  1207.             About:    strings searches the named files for strings of  at
  1208.                       least  num  consecutive  printable characters.   If
  1209.                       found, it prints them.   If  num is not set, it de-
  1210.                       faults to 6.
  1211.  
  1212.             Example:  strings -10 my_file.o binary_file
  1213.  
  1214.             See Also:
  1215.  
  1216.           ________________________________________________________________
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234.  
  1235.  
  1236.  
  1237.  
  1238.  
  1239.  
  1240.  
  1241.  
  1242.  
  1243.  
  1244.  
  1245.  
  1246.  
  1247.  
  1248.  
  1249.  
  1250.  
  1251.           SKsh Amiga Shell            Page 19       External Cmd Reference
  1252.  
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.  
  1260.  
  1261.           ________________________________________________________________
  1262.  
  1263.             Name:     srun
  1264.  
  1265.             Type:     External Command
  1266.  
  1267.             Default:  stk = 4000
  1268.                       pri = 0
  1269.  
  1270.             Usage:    srun [ -i file ] [ -o file ] [ -s stk ] [ -p pri ]
  1271.                          program [ args ]
  1272.  
  1273.             Range:    4000 <= stk
  1274.                       -31 <= pri <= 31
  1275.  
  1276.             About:    srun  was  created to overcome certain deficiencies
  1277.                       in the  AmigaDos  run command.  srun is most useful
  1278.                       in  scripts  or  functions, although it can also be
  1279.                       used  from  the  command  line.   It  allows you to
  1280.                       specify  an  input  file,  output file, stack size,
  1281.                       and  priority  for  a  command which is run in  the
  1282.                       background.    Standard  input and output cannot be
  1283.                       re-directed  with  the  AmigaDos  run command.  The
  1284.                       srun  command is  very  useful in functions such as
  1285.                       the one given  below (very much simplified from one
  1286.                       given in the Stuff.sksh file).
  1287.  
  1288.             Example:  function zmore {
  1289.                          srun -o pipe:tmp $(which zoo) -print "$1" "$2"
  1290.                          more pipe:tmp
  1291.                       }
  1292.  
  1293.             See Also: run
  1294.  
  1295.           ________________________________________________________________
  1296.  
  1297.  
  1298.  
  1299.  
  1300.  
  1301.  
  1302.  
  1303.  
  1304.  
  1305.  
  1306.  
  1307.  
  1308.  
  1309.  
  1310.  
  1311.  
  1312.  
  1313.  
  1314.  
  1315.  
  1316.  
  1317.           SKsh Amiga Shell            Page 20       External Cmd Reference
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.           ________________________________________________________________
  1328.  
  1329.             Name:     tail
  1330.  
  1331.             Type:     External Command
  1332.  
  1333.             Default:  num = 10, '-' option
  1334.  
  1335.             Usage:    tail [ -num | +num ] [ file ... ]
  1336.  
  1337.             Range:    0 <= num <= 32000
  1338.  
  1339.             About:    tail prints the last  num lines of each named file,
  1340.                       or the  standard input if no files are named.  If a
  1341.                       '+'  precedes  num  instead of a '-',  tail instead
  1342.                       skips num lines and prints the rest of the file.
  1343.  
  1344.                       In  SKsh  1.4,  the  algorithm  used  by  tail  was
  1345.                       changed.  If run on a file, it  will  now  seek  to
  1346.                       the end of the  file  and  read  backwards until it
  1347.                       encounters the proper line.  This means  that  run-
  1348.                       ning  tail on a large file is now nearly  instanta-
  1349.                       neous;  previously, it would  read  in  the  entire
  1350.                       file.
  1351.  
  1352.             Example:  tail -15 my_file.c my_other_file.c
  1353.  
  1354.             See Also: head
  1355.  
  1356.           ________________________________________________________________
  1357.  
  1358.  
  1359.  
  1360.  
  1361.  
  1362.  
  1363.  
  1364.  
  1365.  
  1366.  
  1367.  
  1368.  
  1369.  
  1370.  
  1371.  
  1372.  
  1373.  
  1374.  
  1375.  
  1376.  
  1377.  
  1378.  
  1379.  
  1380.  
  1381.  
  1382.  
  1383.           SKsh Amiga Shell            Page 21       External Cmd Reference
  1384.  
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.  
  1392.  
  1393.           ________________________________________________________________
  1394.  
  1395.             Name:     tee
  1396.  
  1397.             Type:     External Command
  1398.  
  1399.             Default:  n/a
  1400.  
  1401.             Usage:    tee [ -a ] [ file ... ]
  1402.  
  1403.             Range:    less than 32 files
  1404.  
  1405.             About:    tee  copies its standard input to its standard out-
  1406.                       put, and also to any named  files.   The  old  con-
  1407.                       tents of the files  are  overwritten unless the ap-
  1408.                       pend (-a) flag is  used.   With  no  arguments, tee
  1409.                       simply copies its input to its output.
  1410.  
  1411.             Example:  fgrep foo my_file | tee save_foo | wc -c
  1412.  
  1413.             See Also:
  1414.  
  1415.           _______________________________________________________________
  1416.  
  1417.  
  1418.  
  1419.  
  1420.  
  1421.  
  1422.  
  1423.  
  1424.  
  1425.  
  1426.  
  1427.  
  1428.  
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.           SKsh Amiga Shell            Page 22       External Cmd Reference
  1450.  
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.  
  1458.  
  1459.           ________________________________________________________________
  1460.  
  1461.             Name:     view
  1462.  
  1463.             Type:     External Command
  1464.  
  1465.             Default:  n/a
  1466.  
  1467.             Usage:    see View.doc
  1468.  
  1469.             Range:    n/a
  1470.  
  1471.             About:    view  is  a  command which allows other commands to
  1472.                       be called based on the type of a given  file.   See
  1473.                       the  View.doc manual  for  a  detail description of
  1474.                       this command.
  1475.  
  1476.             Example:  view myfile my_otherfile
  1477.  
  1478.             See Also:
  1479.  
  1480.           ________________________________________________________________
  1481.  
  1482.  
  1483.  
  1484.  
  1485.  
  1486.  
  1487.  
  1488.  
  1489.  
  1490.  
  1491.  
  1492.  
  1493.  
  1494.  
  1495.  
  1496.  
  1497.  
  1498.  
  1499.  
  1500.  
  1501.  
  1502.  
  1503.  
  1504.  
  1505.  
  1506.  
  1507.  
  1508.  
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514.  
  1515.           SKsh Amiga Shell            Page 23       External Cmd Reference
  1516.  
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.  
  1524.  
  1525.           ________________________________________________________________
  1526.  
  1527.             Name:     wc
  1528.  
  1529.             Type:     External Command
  1530.  
  1531.             Default:  n/a
  1532.  
  1533.             Usage:    wc [ -hcwlqt ] [ file ... ]
  1534.  
  1535.             Range:    n/a
  1536.  
  1537.             About:    wc is a  utility which counts characters, words, or
  1538.                       lines in a  given  series of files (or the standard
  1539.                       input, if  no  files  are  indicated).  It normally
  1540.                       produces  information on all three counts, preceded
  1541.                       by a title for each column.  If  the  c,  w,  or  l
  1542.                       flags  are  set,  only  information on  characters,
  1543.                       words, or lines is  printed.  (These  can  be  com-
  1544.                       bined;  for  example 'wc -cl').  If the q  flag  is
  1545.                       set,  wc does its work  quietly; that is, it leaves
  1546.                       out titles and file names,  only  reporting the ac-
  1547.                       tual counts.  The t flag can be  used  to  obtain a
  1548.                       total at the end, and the h flag prints  a  helpful
  1549.                       usage message.
  1550.  
  1551.             Example:  if [ $(wc -lq my_file) -lt 10 ]
  1552.                       then
  1553.                          echo "There must be at least 10 lines"
  1554.                       fi
  1555.  
  1556.             See Also:
  1557.  
  1558.           ________________________________________________________________
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.           SKsh Amiga Shell            Page 24       External Cmd Reference
  1582.  
  1583.  
  1584.  
  1585.  
  1586.  
  1587.  
  1588.  
  1589.  
  1590.  
  1591.           ________________________________________________________________
  1592.  
  1593.             Name:     window
  1594.  
  1595.             Type:     External Command
  1596.  
  1597.             Default:  n/a
  1598.  
  1599.             Usage:    window [ -back ] [ -front ] [ -title ]
  1600.                          [ -pos [x,y] ] [ -size [x,y] ] [ -scrsize ]
  1601.                          [ -wmouse ] [ -smouse ]
  1602.  
  1603.             Range:    n/a
  1604.  
  1605.             About:    window is a  command which allows parameters of the
  1606.                       current  shell  window to be  modified or examined.
  1607.                       The -back and -front flags cause  the  window to be
  1608.                       sent to the back or front.  The -title flag  causes
  1609.                       the  current  window title to be printed.  The -pos
  1610.                       flag  with  no  following parameters can be used to
  1611.                       find  the  current x and y positions of the window.
  1612.                       With  a  comma  separated set of  numbers, it moves
  1613.                       the  window  to  that  position if possible.  Simi-
  1614.                       larly, the -size  parameter either reports the size
  1615.                       of  the  current  window in  pixels, or resizes the
  1616.                       window to that  size  if  possible.   The  -scrsize
  1617.                       flag  reports  the  current size of the screen con-
  1618.                       taining  this  window, and the -smouse and  -wmouse
  1619.                       flags  report  the  cursor position relative to the
  1620.                       screen or window.
  1621.  
  1622.                       With  no  parameters,  the  window command prints a
  1623.                       helpful  usage message.  Note that this  usage mes-
  1624.                       sage  contains  one  additional option which can be
  1625.                       included  after the -title flag to change the  win-
  1626.                       dow title to  a  set  value.   However, this is not
  1627.                       actually  permitted by  AmigaDos,  and  although it
  1628.                       works now, it  may  cause  problems, and its use is
  1629.                       not recommended.  Use at your own risk.
  1630.  
  1631.             Example:  # move window to back and upper left hand corner
  1632.                       window -back -pos 0,0
  1633.  
  1634.             See Also:
  1635.  
  1636.           ________________________________________________________________
  1637.  
  1638.  
  1639.  
  1640.  
  1641.  
  1642.  
  1643.  
  1644.  
  1645.  
  1646.  
  1647.           SKsh Amiga Shell            Page 25       External Cmd Reference
  1648.  
  1649.  
  1650.  
  1651.  
  1652.  
  1653.  
  1654.  
  1655.  
  1656.  
  1657.           ________________________________________________________________
  1658.  
  1659.             Name:     xd
  1660.  
  1661.             Type:     External Command
  1662.  
  1663.             Default:  n/a
  1664.  
  1665.             Usage:    xd [ file ... ]
  1666.  
  1667.             Range:    n/a
  1668.  
  1669.             About:    xd  (hex  dump)  prints  a  hexadecimal dump of  each
  1670.                       named  file,  or  the  standard input if no files are
  1671.                       named.   It  prints  the  hex  address of the current
  1672.                       offset  as  8  digits, then a hex dump  of  16  bytes
  1673.                       separated into groups of 2 bytes, then an ASCII  rep-
  1674.                       resentation of the 16 bytes, or '.' if  the  byte  is
  1675.                       not a printable character.
  1676.  
  1677.             Example:  xd any_old_file
  1678.  
  1679.             See Also:
  1680.  
  1681.           ________________________________________________________________
  1682.  
  1683.  
  1684.  
  1685.  
  1686.  
  1687.  
  1688.  
  1689.  
  1690.  
  1691.  
  1692.  
  1693.  
  1694.  
  1695.  
  1696.  
  1697.  
  1698.  
  1699.  
  1700.  
  1701.  
  1702.  
  1703.  
  1704.  
  1705.  
  1706.  
  1707.  
  1708.  
  1709.  
  1710.  
  1711.  
  1712.  
  1713.           SKsh Amiga Shell            Page 26       External Cmd Reference
  1714.  
  1715.  
  1716.  
  1717.